package o;

import android.view.View;
import androidx.recyclerview.widget.RecyclerView.j;
import androidx.recyclerview.widget.RecyclerView.t;

public class mv {
    public static int ˋ(t tVar, mq mqVar, View view, View view2, j jVar, boolean z, boolean z2) {
        if (jVar.ˈ() == 0 || tVar.ˏ() == 0 || view == null || view2 == null) {
            return 0;
        }
        int max;
        int min = Math.min(jVar.ˎ(view), jVar.ˎ(view2));
        int max2 = Math.max(jVar.ˎ(view), jVar.ˎ(view2));
        if (z2) {
            max = Math.max(0, (tVar.ˏ() - max2) - 1);
        } else {
            max = Math.max(0, min);
        }
        if (!z) {
            return max;
        }
        return Math.round((((float) max) * (((float) Math.abs(mqVar.ॱ(view2) - mqVar.ˋ(view))) / ((float) (Math.abs(jVar.ˎ(view) - jVar.ˎ(view2)) + 1)))) + ((float) (mqVar.ˏ() - mqVar.ˋ(view))));
    }

    public static int ॱ(t tVar, mq mqVar, View view, View view2, j jVar, boolean z) {
        if (jVar.ˈ() == 0 || tVar.ˏ() == 0 || view == null || view2 == null) {
            return 0;
        }
        if (!z) {
            return Math.abs(jVar.ˎ(view) - jVar.ˎ(view2)) + 1;
        }
        return Math.min(mqVar.ʻ(), mqVar.ॱ(view2) - mqVar.ˋ(view));
    }

    public static int ˎ(t tVar, mq mqVar, View view, View view2, j jVar, boolean z) {
        if (jVar.ˈ() == 0 || tVar.ˏ() == 0 || view == null || view2 == null) {
            return 0;
        }
        if (!z) {
            return tVar.ˏ();
        }
        return (int) ((((float) (mqVar.ॱ(view2) - mqVar.ˋ(view))) / ((float) (Math.abs(jVar.ˎ(view) - jVar.ˎ(view2)) + 1))) * ((float) tVar.ˏ()));
    }
}
